From f6b0433bab7bd24a1b53c3021370f51c9eaa0557 Mon Sep 17 00:00:00 2001
From: Jeffrey Altman <jaltman@auristor.com>
Date: Wed, 16 Nov 2022 17:28:21 -0500
Subject: [PATCH] lib/krb5: krb5_pac_parse mem leak if pac_header_size failure

48 byte memory leak from krb5_pac_parse() each time pac_header_size()
fails.
---
 lib/krb5/pac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/krb5/pac.c b/lib/krb5/pac.c
index 240845f72e..145a7c739c 100644
--- a/lib/krb5/pac.c
+++ b/lib/krb5/pac.c
@@ -204,9 +204,8 @@ krb5_pac_parse(krb5_context context, const void *ptr, size_t len,
     }
 
     ret = pac_header_size(context, tmp, &header_end);
-    if (ret) {
-	return ret;
-    }
+    if (ret)
+	goto out;
 
     p->pac = calloc(1, header_end);
     if (p->pac == NULL) {
